<%@page import="java.util.UUID"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>
<%
	String uuid = UUID.randomUUID().toString();
	request.setAttribute("uuid", uuid);
%>
<div class="box box-primary">
	<div class="row">
		<div class="col-md-4">
			<div class="box-header with-border">
				<h3 class="box-title">
				</h3>
				<div class="box-tools pull-right" id="KBMSCategoryTreeToolBar_${uuid}">
				</div>
			</div>
			<div class="box-body">
				<div id="KBMSCategoryTree_${uuid}" class="ztree">
		   		</div>
			</div>
		</div>
		
		<div class="col-md-8">
				<div class="box-body" id="KBMSCategoryForm_${uuid}"></div>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
var kn_uuid = '${uuid}';
$(function() {
	requirejs(['wiseMen/dataModel/QueryDefTreeTpl'],function(QueryDefTreeTpl,QueryDefTpl){
		var catalogTree=new QueryDefTreeTpl({
			code:"KBMS_CATEGORY",
			modelCode:"KBMS_CATEGORY",
			model:"serverEdit",
			searchBarType:'dialog',
			toolBarDiv:"#KBMSCategoryTreeToolBar_"+kn_uuid,//工具栏定义栏
			treeDiv:"#KBMSCategoryTree_"+kn_uuid,//grid表格
			displayName:'NAME',
			root:{
				NAME:'知识类别'
			},
			onSelect:function(treeNode){
				if(treeNode["ID"]!='-1'){
					if(window.webUtils.hasAnyPermissions("KBMSCTEGORY_MOD")){
						$("#KBMSCategoryForm_${uuid}").load(ctx+"/dataModelDefAct/editTpl.do?dms=KBMS_CATEGORY&KBMS_CATEGORY_ID="+treeNode['ID']+"&winId=${uuid}");
					}else{
						$("#KBMSCategoryForm_${uuid}").load(ctx+"/dataModelDefAct/viewTpl.do?dms=KBMS_CATEGORY&KBMS_CATEGORY_ID="+treeNode['ID']+"&winId=${uuid}");
					}
				}
			}
		});
	});
	

});
</script>